package com.example.controller;

import com.example.dao.impl.CommentDaoImpl;
import com.example.service.CommentService;
import com.example.service.impl.CommentServiceImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Controller
public class CommentController {
    @Resource(name = "commentService")
    public CommentService commentService;

    @RequestMapping("/insertcomment")
    @ResponseBody
    public Integer insertComment(Integer tId,Integer uId,String content) {
        return commentService.insertComment(tId,uId,content);
    }

    @RequestMapping("/user/commentlist")
    @ResponseBody
    public List<Map<String,Object>> getUserCommentList(Integer uId) {
        return commentService.getUserCommentList(uId);
    }
}
